<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo ($col_name); ?>修改</title>
<script type="text/javascript" src="__PUBLIC__/Js/jquery.js"></script>

<link href="__PUBLIC__/Css/green/g_main.css" type="text/css" rel="stylesheet" />
<link href="__PUBLIC__/Css/green/edit.css" type="text/css" rel="stylesheet" />

<script>
function  switch_table(index){
	var group_num="<?php echo (count($group_list)); ?>";
	for(var i=1;i<=group_num;i++){
	   if(i==index){
		   $("#td_"+i).removeClass();
		   $("#td_"+i).addClass("td_dis");
		   $("#table_"+i).css("display","block");
	   }else{
		   $("#td_"+i).removeClass();
		   $("#td_"+i).addClass("td_undis");
		   $("#table_"+i).css("display","none"); 
	   }
	}
}
</script>

</head>

<body>
<div class="edit">
<div class="title-div"><ul><li class="title">编辑信息</li><li class="back"><a href="javascript:history.go(-1);">[ 后退 ]</a></li></ul></div>
<div class="edittable">

<table border="0" cellpadding="0"  cellspacing="0" id="editarea">
<form id="form2" name="form2" method="post" action="<?php echo U('update',$redirect_param); ?>">

<?php if(empty($group_list)): ?><?php foreach($field_name_arr as $k=>$v){
   showformitembyfield($v,$table,"edit",$pk_value);
} ?>
<?php else: ?>
<tr><td colspan="3">
<ul>
<?php if(is_array($group_list)): $i = 0; $__LIST__ = $group_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><?php if(($i)  ==  "1"): ?><li class="td_dis"  id="td_<?php echo ($i); ?>" onclick="switch_table(<?php echo ($i); ?>)"><?php echo ($vo["group_name"]); ?></li>
<?php else: ?>
<li class="td_undis" onclick="switch_table(<?php echo ($i); ?>)" id="td_<?php echo ($i); ?>"><?php echo ($vo["group_name"]); ?></li><?php endif; ?><?php endforeach; endif; else: echo "" ;endif; ?>
</ul>
</td></tr>
<tr><td colspan="3" style="border-bottom:none">
<?php if(is_array($group_list)): $index = 0; $__LIST__ = $group_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$index;$mod = ($index % 2 )?><?php if(($index)  ==  "1"): ?><table cellpadding="0" cellspacing="0" border="0" id="table_<?php echo ($index); ?>" >
<?php else: ?>
<table cellpadding="0" cellspacing="0" border="0" id="table_<?php echo ($index); ?>" style="display:none;"><?php endif; ?>
<?php if(is_array($vo["fields"])): $i = 0; $__LIST__ = $vo["fields"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): ++$i;$mod = ($i % 2 )?><?php echo showformitembyfield($v,$table,"edit",$pk_value);?><?php endforeach; endif; else: echo "" ;endif; ?>
</table><?php endforeach; endif; else: echo "" ;endif; ?>
</td></tr><?php endif; ?>
<tr><td colspan="3" align="center"><input type="submit" name="btn2" id="btn2" value="修 改"   onclick="return true;this.disabled=true"/>
  <input type="reset" name="btn3" id="btn3" value="返 回"/>
  <input type="hidden" name="<?php echo ($pk); ?>" id="<?php echo ($pk); ?>" value="<?php echo ($pk_value); ?>" /></td></tr>
</form>
</table>

</div>
</div>
<script type="text/javascript">
	var ea = document.getElementById('editarea').getElementsByTagName('tr');
	for(var i=0;i<ea.length;i++){
		ea[i].childNodes[0].style.background = '#EEF8F9';	
	}
	var imga = document.getElementsByTagName('img');
	for(var i=0;i<imga.length;i++){
		if(imga[i].parentNode.nodeName.toLowerCase() == 'a'){
			imga[i].parentNode.style.border= '0px';
			imga[i].parentNode.style.background= '#FFF';
		}
	}
</script>
</body>
</html>